#ifndef TREE_STRUCTURES_H
#define TREE_STRUCTURES_H

#define INDEXID 0
#define LEAFID 1

//record size = 200 bytes
class Record {
public:
	int SSN;
	char lastName[32];
	char firstName[32];
	char address[128];
	int major;

};


class Node {
const int d;

public:
	int q;
	int *keys;
	int id;

	Node(): d(64) {
		keys=new int[d+1];
	}
	Node(int d): d(d) {
		keys=new int[d+1];
	}
};

class IndexNode : public Node {
public:
	Node** nodePtrs;
	Node *nextNode;

	IndexNode(): Node() {
		nodePtrs = new Node *[66];
		q=0;
		id = INDEXID;
		nextNode = NULL;
	}
	IndexNode(int d): Node(d) {
		nodePtrs = new Node *[d+2];
		q=0;
		id = INDEXID;
		nextNode = NULL;
	}

};


class LeafNode : public Node {
public:
	Record** records;
	LeafNode *nextLeaf;

	LeafNode(): Node() {
		records = new Record *[64];
		q=0;
		id = LEAFID;
		nextLeaf = NULL;
	}
	LeafNode(int d): Node(d) {
		records = new Record *[d];
		q=0;
		id = LEAFID;
		nextLeaf = NULL;
	}
};

struct stackElement {
	Node *node;
	int index;
};

#endif
